//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS Synthetics service.
///
/// Amazon CloudWatch Synthetics You can use Amazon CloudWatch Synthetics to continually monitor your services. You can create and manage canaries, which are modular, lightweight scripts  that monitor your endpoints and APIs from the outside-in. You can set up your canaries to run 24 hours a day, once per minute. The canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. The canaries seamlessly integrate with CloudWatch ServiceLens to help you trace the causes of impacted nodes in your applications. For more information, see Using ServiceLens to Monitor the Health of Your Applications in the Amazon CloudWatch User Guide. Before you create and manage canaries, be aware of the security considerations. For more information, see Security Considerations for Synthetics Canaries.
public struct Synthetics: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the Synthetics client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "Synthetics",
            serviceIdentifier: "synthetics",
            serviceProtocol: .restjson,
            apiVersion: "2017-10-11",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: SyntheticsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.dualstack]: .init(endpoints: [
            "af-south-1": "synthetics.af-south-1.api.aws",
            "ap-east-1": "synthetics.ap-east-1.api.aws",
            "ap-northeast-1": "synthetics.ap-northeast-1.api.aws",
            "ap-northeast-2": "synthetics.ap-northeast-2.api.aws",
            "ap-northeast-3": "synthetics.ap-northeast-3.api.aws",
            "ap-south-1": "synthetics.ap-south-1.api.aws",
            "ap-south-2": "synthetics.ap-south-2.api.aws",
            "ap-southeast-1": "synthetics.ap-southeast-1.api.aws",
            "ap-southeast-2": "synthetics.ap-southeast-2.api.aws",
            "ap-southeast-3": "synthetics.ap-southeast-3.api.aws",
            "ap-southeast-4": "synthetics.ap-southeast-4.api.aws",
            "ap-southeast-5": "synthetics.ap-southeast-5.api.aws",
            "ap-southeast-7": "synthetics.ap-southeast-7.api.aws",
            "ca-central-1": "synthetics.ca-central-1.api.aws",
            "ca-west-1": "synthetics.ca-west-1.api.aws",
            "cn-north-1": "synthetics.cn-north-1.api.amazonwebservices.com.cn",
            "cn-northwest-1": "synthetics.cn-northwest-1.api.amazonwebservices.com.cn",
            "eu-central-1": "synthetics.eu-central-1.api.aws",
            "eu-central-2": "synthetics.eu-central-2.api.aws",
            "eu-north-1": "synthetics.eu-north-1.api.aws",
            "eu-south-1": "synthetics.eu-south-1.api.aws",
            "eu-south-2": "synthetics.eu-south-2.api.aws",
            "eu-west-1": "synthetics.eu-west-1.api.aws",
            "eu-west-2": "synthetics.eu-west-2.api.aws",
            "eu-west-3": "synthetics.eu-west-3.api.aws",
            "il-central-1": "synthetics.il-central-1.api.aws",
            "me-central-1": "synthetics.me-central-1.api.aws",
            "me-south-1": "synthetics.me-south-1.api.aws",
            "mx-central-1": "synthetics.mx-central-1.api.aws",
            "sa-east-1": "synthetics.sa-east-1.api.aws",
            "us-east-1": "synthetics.us-east-1.api.aws",
            "us-east-2": "synthetics.us-east-2.api.aws",
            "us-gov-east-1": "synthetics.us-gov-east-1.api.aws",
            "us-gov-west-1": "synthetics.us-gov-west-1.api.aws",
            "us-west-1": "synthetics.us-west-1.api.aws",
            "us-west-2": "synthetics.us-west-2.api.aws"
        ]),
        [.dualstack, .fips]: .init(endpoints: [
            "ca-central-1": "synthetics-fips.ca-central-1.api.aws",
            "ca-west-1": "synthetics-fips.ca-west-1.api.aws",
            "us-east-1": "synthetics-fips.us-east-1.api.aws",
            "us-east-2": "synthetics-fips.us-east-2.api.aws",
            "us-gov-east-1": "synthetics-fips.us-gov-east-1.api.aws",
            "us-gov-west-1": "synthetics-fips.us-gov-west-1.api.aws",
            "us-west-1": "synthetics-fips.us-west-1.api.aws",
            "us-west-2": "synthetics-fips.us-west-2.api.aws"
        ]),
        [.fips]: .init(endpoints: [
            "ca-central-1": "synthetics-fips.ca-central-1.amazonaws.com",
            "ca-west-1": "synthetics-fips.ca-west-1.amazonaws.com",
            "us-east-1": "synthetics-fips.us-east-1.amazonaws.com",
            "us-east-2": "synthetics-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "synthetics-fips.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "synthetics-fips.us-gov-west-1.amazonaws.com",
            "us-west-1": "synthetics-fips.us-west-1.amazonaws.com",
            "us-west-2": "synthetics-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Associates a canary with a group. Using groups can help you with managing and automating your canaries, and you can also view aggregated run results and statistics for all canaries in a group.  You must run this operation in the Region where the canary exists.
    @Sendable
    @inlinable
    public func associateResource(_ input: AssociateResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AssociateResourceResponse {
        try await self.client.execute(
            operation: "AssociateResource", 
            path: "/group/{GroupIdentifier}/associate", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Associates a canary with a group. Using groups can help you with managing and automating your canaries, and you can also view aggregated run results and statistics for all canaries in a group.  You must run this operation in the Region where the canary exists.
    ///
    /// Parameters:
    ///   - groupIdentifier: Specifies the group. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
    ///   - resourceArn: The ARN of the canary that you want to associate with the specified group.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateResource(
        groupIdentifier: String,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AssociateResourceResponse {
        let input = AssociateResourceRequest(
            groupIdentifier: groupIdentifier, 
            resourceArn: resourceArn
        )
        return try await self.associateResource(input, logger: logger)
    }

    /// Creates a canary. Canaries are scripts that monitor your endpoints and APIs from the outside-in. Canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. You can set up a canary to run continuously or just once.  Do not use CreateCanary to modify an existing canary. Use UpdateCanary instead. To create canaries, you must have the CloudWatchSyntheticsFullAccess policy. If you are creating a new IAM role for the canary, you also need the iam:CreateRole, iam:CreatePolicy and iam:AttachRolePolicy permissions. For more information, see Necessary Roles and Permissions. Do not include secrets or proprietary information in your canary names. The canary name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
    @Sendable
    @inlinable
    public func createCanary(_ input: CreateCanaryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCanaryResponse {
        try await self.client.execute(
            operation: "CreateCanary", 
            path: "/canary", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a canary. Canaries are scripts that monitor your endpoints and APIs from the outside-in. Canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. You can set up a canary to run continuously or just once.  Do not use CreateCanary to modify an existing canary. Use UpdateCanary instead. To create canaries, you must have the CloudWatchSyntheticsFullAccess policy. If you are creating a new IAM role for the canary, you also need the iam:CreateRole, iam:CreatePolicy and iam:AttachRolePolicy permissions. For more information, see Necessary Roles and Permissions. Do not include secrets or proprietary information in your canary names. The canary name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
    ///
    /// Parameters:
    ///   - artifactConfig: A structure that contains the configuration for canary artifacts, including  the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
    ///   - artifactS3Location: The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files.  The name of the  Amazon S3 bucket can't include a period (.).
    ///   - browserConfigs: CloudWatch Synthetics now supports multibrowser canaries for syn-nodejs-puppeteer-11.0 and syn-nodejs-playwright-3.0 runtimes. This feature allows you to run your canaries on both  Firefox and Chrome browsers. To create a multibrowser canary, you need to specify the BrowserConfigs with a list of browsers you want to use.  If not specified, browserConfigs defaults to Chrome.
    ///   - code: A structure that includes the entry point from which the canary should start running your script. If the script is stored in  an Amazon S3 bucket, the bucket name, key, and version are also included.
    ///   - executionRoleArn: The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:    s3:PutObject     s3:GetBucketLocation     s3:ListAllMyBuckets     cloudwatch:PutMetricData     logs:CreateLogGroup     logs:CreateLogStream     logs:PutLogEvents
    ///   - failureRetentionPeriodInDays: The number of days to retain data about failed runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
    ///   - name: The name for this canary. Be sure to give it a descriptive name  that distinguishes it from other canaries in your account. Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
    ///   - provisionedResourceCleanup: Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If you omit this parameter, the default of AUTOMATIC is used, which means that the Lambda functions and layers will be deleted when the canary is deleted. If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
    ///   - resourcesToReplicateTags: To have the tags that you apply to this canary also be applied to the Lambda function that the canary uses, specify this parameter with the value lambda-function. If you specify this parameter and don't specify any tags in the Tags parameter, the canary creation fails.
    ///   - runConfig: A structure that contains the configuration for individual canary runs,  such as timeout value and environment variables.  Environment variable keys and values are encrypted at rest using Amazon Web Services owned KMS keys. However, the environment variables  are not encrypted on the client side. Do not store sensitive information in them.
    ///   - runtimeVersion: Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see  Canary Runtime Versions.
    ///   - schedule: A structure that contains information about how often the canary is to run and when these test runs are to stop.
    ///   - successRetentionPeriodInDays: The number of days to retain data about successful runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
    ///   - tags: A list of key-value pairs to associate with the canary.  You can associate as many as 50 tags with a canary. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by  granting a user permission to access or change only the resources that have certain tag values. To have the tags that you apply to this canary also be applied to the Lambda function that the canary uses, specify this parameter with the value lambda-function.
    ///   - vpcConfig: If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.  For more information, see  Running a Canary in a VPC.
    ///   - logger: Logger use during operation
    @inlinable
    public func createCanary(
        artifactConfig: ArtifactConfigInput? = nil,
        artifactS3Location: String,
        browserConfigs: [BrowserConfig]? = nil,
        code: CanaryCodeInput,
        executionRoleArn: String,
        failureRetentionPeriodInDays: Int? = nil,
        name: String,
        provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil,
        resourcesToReplicateTags: [ResourceToTag]? = nil,
        runConfig: CanaryRunConfigInput? = nil,
        runtimeVersion: String,
        schedule: CanaryScheduleInput,
        successRetentionPeriodInDays: Int? = nil,
        tags: [String: String]? = nil,
        vpcConfig: VpcConfigInput? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCanaryResponse {
        let input = CreateCanaryRequest(
            artifactConfig: artifactConfig, 
            artifactS3Location: artifactS3Location, 
            browserConfigs: browserConfigs, 
            code: code, 
            executionRoleArn: executionRoleArn, 
            failureRetentionPeriodInDays: failureRetentionPeriodInDays, 
            name: name, 
            provisionedResourceCleanup: provisionedResourceCleanup, 
            resourcesToReplicateTags: resourcesToReplicateTags, 
            runConfig: runConfig, 
            runtimeVersion: runtimeVersion, 
            schedule: schedule, 
            successRetentionPeriodInDays: successRetentionPeriodInDays, 
            tags: tags, 
            vpcConfig: vpcConfig
        )
        return try await self.createCanary(input, logger: logger)
    }

    /// Creates a group which you can use to associate canaries with each other, including cross-Region canaries. Using groups can help you with managing and automating your canaries, and you can also view aggregated run results and statistics for all canaries in a group.  Groups are global resources. When you create a group, it is replicated across Amazon Web Services Regions, and  you can view it and add canaries to it from any Region. Although the group ARN format reflects the Region name where it was created, a group is not constrained to any Region.  This means that you can put canaries from multiple Regions into the same group, and then use that group to view and manage all of those canaries in a single view. Groups are supported in all Regions except the Regions that are disabled by default. For more information about these Regions, see Enabling a Region. Each group can contain as many as 10 canaries. You can have as many as 20 groups in your account. Any single canary can be a member of up to 10 groups.
    @Sendable
    @inlinable
    public func createGroup(_ input: CreateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateGroupResponse {
        try await self.client.execute(
            operation: "CreateGroup", 
            path: "/group", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a group which you can use to associate canaries with each other, including cross-Region canaries. Using groups can help you with managing and automating your canaries, and you can also view aggregated run results and statistics for all canaries in a group.  Groups are global resources. When you create a group, it is replicated across Amazon Web Services Regions, and  you can view it and add canaries to it from any Region. Although the group ARN format reflects the Region name where it was created, a group is not constrained to any Region.  This means that you can put canaries from multiple Regions into the same group, and then use that group to view and manage all of those canaries in a single view. Groups are supported in all Regions except the Regions that are disabled by default. For more information about these Regions, see Enabling a Region. Each group can contain as many as 10 canaries. You can have as many as 20 groups in your account. Any single canary can be a member of up to 10 groups.
    ///
    /// Parameters:
    ///   - name: The name for the group. It can include any Unicode characters. The names for all groups in your account, across all Regions, must be unique.
    ///   - tags: A list of key-value pairs to associate with the group.  You can associate as many as 50 tags with a group. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by  granting a user permission to access or change only the resources that have certain tag values.
    ///   - logger: Logger use during operation
    @inlinable
    public func createGroup(
        name: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateGroupResponse {
        let input = CreateGroupRequest(
            name: name, 
            tags: tags
        )
        return try await self.createGroup(input, logger: logger)
    }

    /// Permanently deletes the specified canary. If the canary's ProvisionedResourceCleanup field is set to AUTOMATIC  or you specify DeleteLambda in this operation as true, CloudWatch Synthetics also deletes the Lambda functions and layers that are used by the canary. Other resources used and created by the canary are not automatically deleted.  After you delete a canary, you should also delete the following:   The CloudWatch alarms created for this canary. These alarms have a name of Synthetics-Alarm-first-198-characters-of-canary-name-canaryId-alarm number     Amazon S3 objects and buckets, such as the canary's artifact location.   IAM roles created for the canary. If they were created in the console, these roles have the name  role/service-role/CloudWatchSyntheticsRole-First-21-Characters-of-CanaryName     CloudWatch Logs log groups created for the canary. These logs groups have the name /aws/lambda/cwsyn-First-21-Characters-of-CanaryName     Before you delete a canary, you might want to use GetCanary to display the information about this canary. Make note of the information returned by this operation so that you can delete these resources after you delete the canary.
    @Sendable
    @inlinable
    public func deleteCanary(_ input: DeleteCanaryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteCanaryResponse {
        try await self.client.execute(
            operation: "DeleteCanary", 
            path: "/canary/{Name}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Permanently deletes the specified canary. If the canary's ProvisionedResourceCleanup field is set to AUTOMATIC  or you specify DeleteLambda in this operation as true, CloudWatch Synthetics also deletes the Lambda functions and layers that are used by the canary. Other resources used and created by the canary are not automatically deleted.  After you delete a canary, you should also delete the following:   The CloudWatch alarms created for this canary. These alarms have a name of Synthetics-Alarm-first-198-characters-of-canary-name-canaryId-alarm number     Amazon S3 objects and buckets, such as the canary's artifact location.   IAM roles created for the canary. If they were created in the console, these roles have the name  role/service-role/CloudWatchSyntheticsRole-First-21-Characters-of-CanaryName     CloudWatch Logs log groups created for the canary. These logs groups have the name /aws/lambda/cwsyn-First-21-Characters-of-CanaryName     Before you delete a canary, you might want to use GetCanary to display the information about this canary. Make note of the information returned by this operation so that you can delete these resources after you delete the canary.
    ///
    /// Parameters:
    ///   - deleteLambda: Specifies whether to also delete the Lambda functions and layers used by this canary. The default is false. Your setting for this parameter is used only if the canary doesn't have AUTOMATIC for its  ProvisionedResourceCleanup field. If that field is set to AUTOMATIC, then the  Lambda functions and layers will be deleted when this canary is deleted.  Type: Boolean
    ///   - name: The name of the canary that you want to delete. To find the names of your canaries, use DescribeCanaries.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteCanary(
        deleteLambda: Bool? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteCanaryResponse {
        let input = DeleteCanaryRequest(
            deleteLambda: deleteLambda, 
            name: name
        )
        return try await self.deleteCanary(input, logger: logger)
    }

    /// Deletes a group. The group doesn't need to be empty to be deleted. If there are canaries in the group, they are not deleted when you delete the group.  Groups are a global resource that appear in all Regions, but the request to delete a group must be made from its home Region. You can find the home Region of a group within its ARN.
    @Sendable
    @inlinable
    public func deleteGroup(_ input: DeleteGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGroupResponse {
        try await self.client.execute(
            operation: "DeleteGroup", 
            path: "/group/{GroupIdentifier}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a group. The group doesn't need to be empty to be deleted. If there are canaries in the group, they are not deleted when you delete the group.  Groups are a global resource that appear in all Regions, but the request to delete a group must be made from its home Region. You can find the home Region of a group within its ARN.
    ///
    /// Parameters:
    ///   - groupIdentifier: Specifies which group to delete. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGroup(
        groupIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGroupResponse {
        let input = DeleteGroupRequest(
            groupIdentifier: groupIdentifier
        )
        return try await self.deleteGroup(input, logger: logger)
    }

    /// This operation returns a list of the canaries in your account, along with full details about each canary. This operation supports resource-level authorization using an IAM policy and  the Names parameter. If you specify the Names parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    @Sendable
    @inlinable
    public func describeCanaries(_ input: DescribeCanariesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeCanariesResponse {
        try await self.client.execute(
            operation: "DescribeCanaries", 
            path: "/canaries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This operation returns a list of the canaries in your account, along with full details about each canary. This operation supports resource-level authorization using an IAM policy and  the Names parameter. If you specify the Names parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    ///
    /// Parameters:
    ///   - maxResults: Specify this parameter to limit how many canaries are returned each time you use the DescribeCanaries operation. If you omit this parameter, the default of 20 is used.
    ///   - names: Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use this parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeCanaries(
        maxResults: Int? = nil,
        names: [String]? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeCanariesResponse {
        let input = DescribeCanariesRequest(
            maxResults: maxResults, 
            names: names, 
            nextToken: nextToken
        )
        return try await self.describeCanaries(input, logger: logger)
    }

    /// Use this operation to see information from the most recent run of each canary that you have created. This operation supports resource-level authorization using an IAM policy and  the Names parameter. If you specify the Names parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    @Sendable
    @inlinable
    public func describeCanariesLastRun(_ input: DescribeCanariesLastRunRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeCanariesLastRunResponse {
        try await self.client.execute(
            operation: "DescribeCanariesLastRun", 
            path: "/canaries/last-run", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Use this operation to see information from the most recent run of each canary that you have created. This operation supports resource-level authorization using an IAM policy and  the Names parameter. If you specify the Names parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    ///
    /// Parameters:
    ///   - browserType: The type of browser to use for the canary run.
    ///   - maxResults: Specify this parameter to limit how many runs are returned each time you use the DescribeLastRun operation. If you omit this parameter, the default of 100 is used.
    ///   - names: Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanariesLastRun operation to retrieve the next  set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeCanariesLastRun(
        browserType: BrowserType? = nil,
        maxResults: Int? = nil,
        names: [String]? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeCanariesLastRunResponse {
        let input = DescribeCanariesLastRunRequest(
            browserType: browserType, 
            maxResults: maxResults, 
            names: names, 
            nextToken: nextToken
        )
        return try await self.describeCanariesLastRun(input, logger: logger)
    }

    /// Returns a list of Synthetics canary runtime versions. For more information,  see  Canary Runtime Versions.
    @Sendable
    @inlinable
    public func describeRuntimeVersions(_ input: DescribeRuntimeVersionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeRuntimeVersionsResponse {
        try await self.client.execute(
            operation: "DescribeRuntimeVersions", 
            path: "/runtime-versions", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of Synthetics canary runtime versions. For more information,  see  Canary Runtime Versions.
    ///
    /// Parameters:
    ///   - maxResults: Specify this parameter to limit how many runs are returned each time you use the DescribeRuntimeVersions operation. If you omit this parameter, the default of 100 is used.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent DescribeRuntimeVersions operation to retrieve the next  set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeRuntimeVersions(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeRuntimeVersionsResponse {
        let input = DescribeRuntimeVersionsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.describeRuntimeVersions(input, logger: logger)
    }

    /// Removes a canary from a group. You must run this operation in the Region where the canary exists.
    @Sendable
    @inlinable
    public func disassociateResource(_ input: DisassociateResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisassociateResourceResponse {
        try await self.client.execute(
            operation: "DisassociateResource", 
            path: "/group/{GroupIdentifier}/disassociate", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes a canary from a group. You must run this operation in the Region where the canary exists.
    ///
    /// Parameters:
    ///   - groupIdentifier: Specifies the group. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
    ///   - resourceArn: The ARN of the canary that you want to remove from the specified group.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateResource(
        groupIdentifier: String,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisassociateResourceResponse {
        let input = DisassociateResourceRequest(
            groupIdentifier: groupIdentifier, 
            resourceArn: resourceArn
        )
        return try await self.disassociateResource(input, logger: logger)
    }

    /// Retrieves complete information about one canary. You must specify the name of the canary that you want. To get a list of canaries and their names, use DescribeCanaries.
    @Sendable
    @inlinable
    public func getCanary(_ input: GetCanaryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCanaryResponse {
        try await self.client.execute(
            operation: "GetCanary", 
            path: "/canary/{Name}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves complete information about one canary. You must specify the name of the canary that you want. To get a list of canaries and their names, use DescribeCanaries.
    ///
    /// Parameters:
    ///   - dryRunId: The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
    ///   - name: The name of the canary that you want details for.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCanary(
        dryRunId: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCanaryResponse {
        let input = GetCanaryRequest(
            dryRunId: dryRunId, 
            name: name
        )
        return try await self.getCanary(input, logger: logger)
    }

    /// Retrieves a list of runs for a specified canary.
    @Sendable
    @inlinable
    public func getCanaryRuns(_ input: GetCanaryRunsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCanaryRunsResponse {
        try await self.client.execute(
            operation: "GetCanaryRuns", 
            path: "/canary/{Name}/runs", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a list of runs for a specified canary.
    ///
    /// Parameters:
    ///   - dryRunId: The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
    ///   - maxResults: Specify this parameter to limit how many runs are returned each time you use the GetCanaryRuns operation. If you omit this parameter, the default of 100 is used.
    ///   - name: The name of the canary that you want to see runs for.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns operation to retrieve the next  set of results.  When auto retry is enabled for the canary, the first subsequent retry is suffixed with *1 indicating its the first retry and the next subsequent try is suffixed with *2.
    ///   - runType:   When you provide RunType=CANARY_RUN and dryRunId, you will get an exception      When a value is not provided for RunType, the default value is CANARY_RUN    When CANARY_RUN is provided, all canary runs excluding dry runs are returned   When DRY_RUN is provided, all dry runs excluding canary runs are returned
    ///   - logger: Logger use during operation
    @inlinable
    public func getCanaryRuns(
        dryRunId: String? = nil,
        maxResults: Int? = nil,
        name: String,
        nextToken: String? = nil,
        runType: RunType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCanaryRunsResponse {
        let input = GetCanaryRunsRequest(
            dryRunId: dryRunId, 
            maxResults: maxResults, 
            name: name, 
            nextToken: nextToken, 
            runType: runType
        )
        return try await self.getCanaryRuns(input, logger: logger)
    }

    /// Returns information about one group. Groups are a global resource, so you can use this operation from any Region.
    @Sendable
    @inlinable
    public func getGroup(_ input: GetGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetGroupResponse {
        try await self.client.execute(
            operation: "GetGroup", 
            path: "/group/{GroupIdentifier}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about one group. Groups are a global resource, so you can use this operation from any Region.
    ///
    /// Parameters:
    ///   - groupIdentifier: Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getGroup(
        groupIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetGroupResponse {
        let input = GetGroupRequest(
            groupIdentifier: groupIdentifier
        )
        return try await self.getGroup(input, logger: logger)
    }

    /// Returns a list of the groups that the specified canary is associated with. The canary that you specify must be in the current Region.
    @Sendable
    @inlinable
    public func listAssociatedGroups(_ input: ListAssociatedGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAssociatedGroupsResponse {
        try await self.client.execute(
            operation: "ListAssociatedGroups", 
            path: "/resource/{ResourceArn}/groups", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of the groups that the specified canary is associated with. The canary that you specify must be in the current Region.
    ///
    /// Parameters:
    ///   - maxResults: Specify this parameter to limit how many groups are returned each time you use the ListAssociatedGroups operation. If you omit this parameter, the default of 20 is used.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
    ///   - resourceArn: The ARN of the canary that you want to view groups for.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAssociatedGroups(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAssociatedGroupsResponse {
        let input = ListAssociatedGroupsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            resourceArn: resourceArn
        )
        return try await self.listAssociatedGroups(input, logger: logger)
    }

    /// This operation returns a list of the ARNs of the canaries that are associated with the specified group.
    @Sendable
    @inlinable
    public func listGroupResources(_ input: ListGroupResourcesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupResourcesResponse {
        try await self.client.execute(
            operation: "ListGroupResources", 
            path: "/group/{GroupIdentifier}/resources", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This operation returns a list of the ARNs of the canaries that are associated with the specified group.
    ///
    /// Parameters:
    ///   - groupIdentifier: Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
    ///   - maxResults: Specify this parameter to limit how many canary ARNs are returned each time you use the ListGroupResources operation. If you omit this parameter, the default of 20 is used.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroupResources(
        groupIdentifier: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupResourcesResponse {
        let input = ListGroupResourcesRequest(
            groupIdentifier: groupIdentifier, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listGroupResources(input, logger: logger)
    }

    /// Returns a list of all groups in the account, displaying their names, unique IDs, and ARNs. The groups from all Regions are returned.
    @Sendable
    @inlinable
    public func listGroups(_ input: ListGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupsResponse {
        try await self.client.execute(
            operation: "ListGroups", 
            path: "/groups", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of all groups in the account, displaying their names, unique IDs, and ARNs. The groups from all Regions are returned.
    ///
    /// Parameters:
    ///   - maxResults: Specify this parameter to limit how many groups are returned each time you use the ListGroups operation. If you omit this parameter, the default of 20 is used.
    ///   - nextToken: A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroups(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupsResponse {
        let input = ListGroupsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listGroups(input, logger: logger)
    }

    /// Displays the tags associated with a canary or group.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Displays the tags associated with a canary or group.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the canary or group that you want to view tags for. The ARN format of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Use this operation to run a canary that has already been created.   The frequency of the canary runs is determined by the value of the canary's Schedule. To see a canary's schedule,  use GetCanary.
    @Sendable
    @inlinable
    public func startCanary(_ input: StartCanaryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartCanaryResponse {
        try await self.client.execute(
            operation: "StartCanary", 
            path: "/canary/{Name}/start", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Use this operation to run a canary that has already been created.   The frequency of the canary runs is determined by the value of the canary's Schedule. To see a canary's schedule,  use GetCanary.
    ///
    /// Parameters:
    ///   - name: The name of the canary that you want to run. To find canary names, use DescribeCanaries.
    ///   - logger: Logger use during operation
    @inlinable
    public func startCanary(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartCanaryResponse {
        let input = StartCanaryRequest(
            name: name
        )
        return try await self.startCanary(input, logger: logger)
    }

    /// Use this operation to start a dry run for a canary that has already been created
    @Sendable
    @inlinable
    public func startCanaryDryRun(_ input: StartCanaryDryRunRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartCanaryDryRunResponse {
        try await self.client.execute(
            operation: "StartCanaryDryRun", 
            path: "/canary/{Name}/dry-run/start", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Use this operation to start a dry run for a canary that has already been created
    ///
    /// Parameters:
    ///   - artifactConfig: 
    ///   - artifactS3Location: The location in Amazon S3 where Synthetics stores artifacts from the test runs of this
    ///   - browserConfigs: A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both CHROME and FIREFOX browsers.  If not specified, browserConfigs defaults to Chrome.
    ///   - code: 
    ///   - executionRoleArn: The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:
    ///   - failureRetentionPeriodInDays: The number of days to retain data about failed runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
    ///   - name: The name of the canary that you want to dry run. To find canary names, use DescribeCanaries.
    ///   - provisionedResourceCleanup: Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If you omit this parameter, the default of AUTOMATIC is used, which means
    ///   - runConfig: 
    ///   - runtimeVersion: Specifies the runtime version to use for the canary.   For a list of valid runtime versions and for more information about runtime versions, see  Canary Runtime Versions.
    ///   - successRetentionPeriodInDays: The number of days to retain data about successful runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
    ///   - visualReference: 
    ///   - visualReferences: A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.  syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, only supports visualReferences. visualReference field is not supported. Versions older than syn-nodejs-puppeteer-11.0 supports both visualReference and visualReferences for backward compatibility. It is recommended to use visualReferences for consistency and future compatibility.
    ///   - vpcConfig: 
    ///   - logger: Logger use during operation
    @inlinable
    public func startCanaryDryRun(
        artifactConfig: ArtifactConfigInput? = nil,
        artifactS3Location: String? = nil,
        browserConfigs: [BrowserConfig]? = nil,
        code: CanaryCodeInput? = nil,
        executionRoleArn: String? = nil,
        failureRetentionPeriodInDays: Int? = nil,
        name: String,
        provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil,
        runConfig: CanaryRunConfigInput? = nil,
        runtimeVersion: String? = nil,
        successRetentionPeriodInDays: Int? = nil,
        visualReference: VisualReferenceInput? = nil,
        visualReferences: [VisualReferenceInput]? = nil,
        vpcConfig: VpcConfigInput? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartCanaryDryRunResponse {
        let input = StartCanaryDryRunRequest(
            artifactConfig: artifactConfig, 
            artifactS3Location: artifactS3Location, 
            browserConfigs: browserConfigs, 
            code: code, 
            executionRoleArn: executionRoleArn, 
            failureRetentionPeriodInDays: failureRetentionPeriodInDays, 
            name: name, 
            provisionedResourceCleanup: provisionedResourceCleanup, 
            runConfig: runConfig, 
            runtimeVersion: runtimeVersion, 
            successRetentionPeriodInDays: successRetentionPeriodInDays, 
            visualReference: visualReference, 
            visualReferences: visualReferences, 
            vpcConfig: vpcConfig
        )
        return try await self.startCanaryDryRun(input, logger: logger)
    }

    /// Stops the canary to prevent all future runs. If the canary is currently running,the run that is in progress completes on its own, publishes metrics, and uploads artifacts, but it is not recorded in Synthetics as a completed run. You can use StartCanary to start it running again  with the canary’s current schedule at any point in the future.
    @Sendable
    @inlinable
    public func stopCanary(_ input: StopCanaryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopCanaryResponse {
        try await self.client.execute(
            operation: "StopCanary", 
            path: "/canary/{Name}/stop", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops the canary to prevent all future runs. If the canary is currently running,the run that is in progress completes on its own, publishes metrics, and uploads artifacts, but it is not recorded in Synthetics as a completed run. You can use StartCanary to start it running again  with the canary’s current schedule at any point in the future.
    ///
    /// Parameters:
    ///   - name: The name of the canary that you want to stop. To find the names of your  canaries, use ListCanaries.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopCanary(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopCanaryResponse {
        let input = StopCanaryRequest(
            name: name
        )
        return try await self.stopCanary(input, logger: logger)
    }

    /// Assigns one or more tags (key-value pairs) to the specified canary or group.  Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values. Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters. You can use the TagResource action with a resource that already has tags. If you specify a new  tag key for the resource,  this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag  value that you specify replaces the previous value for that tag. You can associate as many as 50 tags with a canary or group.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Assigns one or more tags (key-value pairs) to the specified canary or group.  Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values. Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters. You can use the TagResource action with a resource that already has tags. If you specify a new  tag key for the resource,  this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag  value that you specify replaces the previous value for that tag. You can associate as many as 50 tags with a canary or group.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the canary or group that you're adding tags to. The ARN format of a canary is
    ///   - tags: The list of key-value pairs to associate with the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes one or more tags from the specified resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes one or more tags from the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the canary or group that you're removing tags from. The ARN format of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
    ///   - tagKeys: The list of tag keys to remove from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates the configuration of a canary that has already been created. For multibrowser canaries, you can add or remove browsers by updating the browserConfig list in the update call. For example:   To add Firefox to a canary that currently uses Chrome, specify browserConfigs as [CHROME, FIREFOX]   To remove Firefox and keep only Chrome, specify browserConfigs as [CHROME]   You can't use this operation to update the tags of an existing canary. To change the tags of an existing canary, use TagResource.  When you use the dryRunId field when updating a canary, the only other field you can provide is the Schedule. Adding any other field will thrown an exception.
    @Sendable
    @inlinable
    public func updateCanary(_ input: UpdateCanaryRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCanaryResponse {
        try await self.client.execute(
            operation: "UpdateCanary", 
            path: "/canary/{Name}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the configuration of a canary that has already been created. For multibrowser canaries, you can add or remove browsers by updating the browserConfig list in the update call. For example:   To add Firefox to a canary that currently uses Chrome, specify browserConfigs as [CHROME, FIREFOX]   To remove Firefox and keep only Chrome, specify browserConfigs as [CHROME]   You can't use this operation to update the tags of an existing canary. To change the tags of an existing canary, use TagResource.  When you use the dryRunId field when updating a canary, the only other field you can provide is the Schedule. Adding any other field will thrown an exception.
    ///
    /// Parameters:
    ///   - artifactConfig: A structure that contains the configuration for canary artifacts,  including the encryption-at-rest settings for artifacts that  the canary uploads to Amazon S3.
    ///   - artifactS3Location: The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.  Artifacts include the log file, screenshots, and HAR files. The name of the Amazon S3 bucket can't include a period (.).
    ///   - browserConfigs: A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both CHROME and FIREFOX browsers.  If not specified, browserConfigs defaults to Chrome.
    ///   - code: A structure that includes the entry point from which the canary should start running your script. If the script is stored in  an Amazon S3 bucket, the bucket name, key, and version are also included.
    ///   - dryRunId: Update the existing canary using the updated configurations from the DryRun associated with the DryRunId.  When you use the dryRunId field when updating a canary, the only other field you can provide is the Schedule. Adding any other field will thrown an exception.
    ///   - executionRoleArn: The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:    s3:PutObject     s3:GetBucketLocation     s3:ListAllMyBuckets     cloudwatch:PutMetricData     logs:CreateLogGroup     logs:CreateLogStream     logs:CreateLogStream
    ///   - failureRetentionPeriodInDays: The number of days to retain data about failed runs of this canary. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
    ///   - name: The name of the canary that you want to update. To find the names of your  canaries, use DescribeCanaries. You cannot change the name of a canary that has already been created.
    ///   - provisionedResourceCleanup: Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
    ///   - runConfig: A structure that contains the timeout value that is used for each individual run of the  canary.  Environment variable keys and values are encrypted at rest using Amazon Web Services owned KMS keys. However, the environment variables  are not encrypted on the client side. Do not store sensitive information in them.
    ///   - runtimeVersion: Specifies the runtime version to use for the canary.   For a list of valid runtime versions and for more information about runtime versions, see  Canary Runtime Versions.
    ///   - schedule: A structure that contains information about how often the canary is to run, and when these runs are to stop.
    ///   - successRetentionPeriodInDays: The number of days to retain data about successful runs of this canary. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
    ///   - visualReference: Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary. If you omit this  parameter, no changes are made to any baseline screenshots that the canary might be using already. Visual monitoring is supported only on canaries running the syn-puppeteer-node-3.2 runtime or later. For more information, see  Visual monitoring and  Visual monitoring blueprint
    ///   - visualReferences: A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.  syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, only supports visualReferences. visualReference field is not supported. Versions older than syn-nodejs-puppeteer-11.0 supports both visualReference and visualReferences for backward compatibility. It is recommended to use visualReferences for consistency and future compatibility. For multibrowser visual monitoring,  you can update the baseline for all configured browsers in a single update call by specifying a list of VisualReference objects, one per browser.  Each VisualReference object maps to a specific browser configuration, allowing you to manage visual baselines for multiple browsers simultaneously. For single configuration canaries using Chrome browser (default browser), use visualReferences for syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and  above canaries. The browserType in the visualReference object is not mandatory.
    ///   - vpcConfig: If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.  For more information, see  Running a Canary in a VPC.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCanary(
        artifactConfig: ArtifactConfigInput? = nil,
        artifactS3Location: String? = nil,
        browserConfigs: [BrowserConfig]? = nil,
        code: CanaryCodeInput? = nil,
        dryRunId: String? = nil,
        executionRoleArn: String? = nil,
        failureRetentionPeriodInDays: Int? = nil,
        name: String,
        provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil,
        runConfig: CanaryRunConfigInput? = nil,
        runtimeVersion: String? = nil,
        schedule: CanaryScheduleInput? = nil,
        successRetentionPeriodInDays: Int? = nil,
        visualReference: VisualReferenceInput? = nil,
        visualReferences: [VisualReferenceInput]? = nil,
        vpcConfig: VpcConfigInput? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCanaryResponse {
        let input = UpdateCanaryRequest(
            artifactConfig: artifactConfig, 
            artifactS3Location: artifactS3Location, 
            browserConfigs: browserConfigs, 
            code: code, 
            dryRunId: dryRunId, 
            executionRoleArn: executionRoleArn, 
            failureRetentionPeriodInDays: failureRetentionPeriodInDays, 
            name: name, 
            provisionedResourceCleanup: provisionedResourceCleanup, 
            runConfig: runConfig, 
            runtimeVersion: runtimeVersion, 
            schedule: schedule, 
            successRetentionPeriodInDays: successRetentionPeriodInDays, 
            visualReference: visualReference, 
            visualReferences: visualReferences, 
            vpcConfig: vpcConfig
        )
        return try await self.updateCanary(input, logger: logger)
    }
}

extension Synthetics {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: Synthetics, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Synthetics {
    /// Return PaginatorSequence for operation ``describeCanaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeCanariesPaginator(
        _ input: DescribeCanariesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeCanariesRequest, DescribeCanariesResponse> {
        return .init(
            input: input,
            command: self.describeCanaries,
            inputKey: \DescribeCanariesRequest.nextToken,
            outputKey: \DescribeCanariesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeCanaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Specify this parameter to limit how many canaries are returned each time you use the DescribeCanaries operation. If you omit this parameter, the default of 20 is used.
    ///   - names: Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use this parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeCanariesPaginator(
        maxResults: Int? = nil,
        names: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeCanariesRequest, DescribeCanariesResponse> {
        let input = DescribeCanariesRequest(
            maxResults: maxResults, 
            names: names
        )
        return self.describeCanariesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``describeCanariesLastRun(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeCanariesLastRunPaginator(
        _ input: DescribeCanariesLastRunRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeCanariesLastRunRequest, DescribeCanariesLastRunResponse> {
        return .init(
            input: input,
            command: self.describeCanariesLastRun,
            inputKey: \DescribeCanariesLastRunRequest.nextToken,
            outputKey: \DescribeCanariesLastRunResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeCanariesLastRun(_:logger:)``.
    ///
    /// - Parameters:
    ///   - browserType: The type of browser to use for the canary run.
    ///   - maxResults: Specify this parameter to limit how many runs are returned each time you use the DescribeLastRun operation. If you omit this parameter, the default of 100 is used.
    ///   - names: Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeCanariesLastRunPaginator(
        browserType: BrowserType? = nil,
        maxResults: Int? = nil,
        names: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeCanariesLastRunRequest, DescribeCanariesLastRunResponse> {
        let input = DescribeCanariesLastRunRequest(
            browserType: browserType, 
            maxResults: maxResults, 
            names: names
        )
        return self.describeCanariesLastRunPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``describeRuntimeVersions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func describeRuntimeVersionsPaginator(
        _ input: DescribeRuntimeVersionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<DescribeRuntimeVersionsRequest, DescribeRuntimeVersionsResponse> {
        return .init(
            input: input,
            command: self.describeRuntimeVersions,
            inputKey: \DescribeRuntimeVersionsRequest.nextToken,
            outputKey: \DescribeRuntimeVersionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``describeRuntimeVersions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Specify this parameter to limit how many runs are returned each time you use the DescribeRuntimeVersions operation. If you omit this parameter, the default of 100 is used.
    ///   - logger: Logger used for logging
    @inlinable
    public func describeRuntimeVersionsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<DescribeRuntimeVersionsRequest, DescribeRuntimeVersionsResponse> {
        let input = DescribeRuntimeVersionsRequest(
            maxResults: maxResults
        )
        return self.describeRuntimeVersionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getCanaryRuns(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getCanaryRunsPaginator(
        _ input: GetCanaryRunsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetCanaryRunsRequest, GetCanaryRunsResponse> {
        return .init(
            input: input,
            command: self.getCanaryRuns,
            inputKey: \GetCanaryRunsRequest.nextToken,
            outputKey: \GetCanaryRunsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getCanaryRuns(_:logger:)``.
    ///
    /// - Parameters:
    ///   - dryRunId: The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
    ///   - maxResults: Specify this parameter to limit how many runs are returned each time you use the GetCanaryRuns operation. If you omit this parameter, the default of 100 is used.
    ///   - name: The name of the canary that you want to see runs for.
    ///   - runType:   When you provide RunType=CANARY_RUN and dryRunId, you will get an exception      When a value is not provided for RunType, the default value is CANARY_RUN    When CANARY_RUN is provided, all canary runs excluding dry runs are returned   When DRY_RUN is provided, all dry runs excluding canary runs are returned
    ///   - logger: Logger used for logging
    @inlinable
    public func getCanaryRunsPaginator(
        dryRunId: String? = nil,
        maxResults: Int? = nil,
        name: String,
        runType: RunType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetCanaryRunsRequest, GetCanaryRunsResponse> {
        let input = GetCanaryRunsRequest(
            dryRunId: dryRunId, 
            maxResults: maxResults, 
            name: name, 
            runType: runType
        )
        return self.getCanaryRunsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAssociatedGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAssociatedGroupsPaginator(
        _ input: ListAssociatedGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAssociatedGroupsRequest, ListAssociatedGroupsResponse> {
        return .init(
            input: input,
            command: self.listAssociatedGroups,
            inputKey: \ListAssociatedGroupsRequest.nextToken,
            outputKey: \ListAssociatedGroupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAssociatedGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Specify this parameter to limit how many groups are returned each time you use the ListAssociatedGroups operation. If you omit this parameter, the default of 20 is used.
    ///   - resourceArn: The ARN of the canary that you want to view groups for.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAssociatedGroupsPaginator(
        maxResults: Int? = nil,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAssociatedGroupsRequest, ListAssociatedGroupsResponse> {
        let input = ListAssociatedGroupsRequest(
            maxResults: maxResults, 
            resourceArn: resourceArn
        )
        return self.listAssociatedGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listGroupResources(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupResourcesPaginator(
        _ input: ListGroupResourcesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupResourcesRequest, ListGroupResourcesResponse> {
        return .init(
            input: input,
            command: self.listGroupResources,
            inputKey: \ListGroupResourcesRequest.nextToken,
            outputKey: \ListGroupResourcesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroupResources(_:logger:)``.
    ///
    /// - Parameters:
    ///   - groupIdentifier: Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
    ///   - maxResults: Specify this parameter to limit how many canary ARNs are returned each time you use the ListGroupResources operation. If you omit this parameter, the default of 20 is used.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupResourcesPaginator(
        groupIdentifier: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupResourcesRequest, ListGroupResourcesResponse> {
        let input = ListGroupResourcesRequest(
            groupIdentifier: groupIdentifier, 
            maxResults: maxResults
        )
        return self.listGroupResourcesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsPaginator(
        _ input: ListGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupsRequest, ListGroupsResponse> {
        return .init(
            input: input,
            command: self.listGroups,
            inputKey: \ListGroupsRequest.nextToken,
            outputKey: \ListGroupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Specify this parameter to limit how many groups are returned each time you use the ListGroups operation. If you omit this parameter, the default of 20 is used.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupsRequest, ListGroupsResponse> {
        let input = ListGroupsRequest(
            maxResults: maxResults
        )
        return self.listGroupsPaginator(input, logger: logger)
    }
}

extension Synthetics.DescribeCanariesLastRunRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.DescribeCanariesLastRunRequest {
        return .init(
            browserType: self.browserType,
            maxResults: self.maxResults,
            names: self.names,
            nextToken: token
        )
    }
}

extension Synthetics.DescribeCanariesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.DescribeCanariesRequest {
        return .init(
            maxResults: self.maxResults,
            names: self.names,
            nextToken: token
        )
    }
}

extension Synthetics.DescribeRuntimeVersionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.DescribeRuntimeVersionsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension Synthetics.GetCanaryRunsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.GetCanaryRunsRequest {
        return .init(
            dryRunId: self.dryRunId,
            maxResults: self.maxResults,
            name: self.name,
            nextToken: token,
            runType: self.runType
        )
    }
}

extension Synthetics.ListAssociatedGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.ListAssociatedGroupsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            resourceArn: self.resourceArn
        )
    }
}

extension Synthetics.ListGroupResourcesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.ListGroupResourcesRequest {
        return .init(
            groupIdentifier: self.groupIdentifier,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension Synthetics.ListGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Synthetics.ListGroupsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
